// 	Name: 08.c
//	Description: Chapter 2 project 8
//	Author: StableGenius
//	Date: 2020-05-06
//	Email: feng@dongfa.pro

#include <stdio.h>

int main(void)
{
	float amount, rate, payment;
	
	printf("Enter amount of loan: ");
	scanf("%f", &amount);
	
	printf("Enter interest rate: ");
	scanf("%f", &rate);
	
	printf("Enter monthly payment: ");
	scanf("%f", &payment);
	
	amount = (amount - payment) + amount * rate / 100 / 12;
	printf("Balance remaining after first payment: $%.2f\n", amount);
	
	amount = (amount - payment) + amount * rate / 100 / 12;
	printf("Balance remaining after second payment: $%.2f\n", amount);
	
	amount = (amount - payment) + amount * rate / 100 / 12;
	printf("Balance remaining after third payment: $%.2f\n", amount);

    return 0;
}
